Skip to content

Implement Rust testing framework - #187

Closed
vishwamartur wants to merge 1 commit into
CapSoftware:mainfrom
vishwamartur:add-rust-testing-framework
Closed

vishwamartur wants to merge 1 commit into
CapSoftware:mainfrom
vishwamartur:add-rust-testing-framework

Conversation

@vishwamartur

@vishwamartur vishwamartur commented Nov 27, 2024 •

Copy link
Copy Markdown

Related to #184

Implement a scalable testing system for Rust functions in the Cap desktop application.

  • Add test cases: Create a new file apps/desktop/src-tauri/tests/desktop_tests.rs with test cases for start_recording, stop_recording, copy_file_to_path, copy_screenshot_to_clipboard, and export_video.
  • Update package.json: Add a new command test:desktop in apps/desktop/package.json to run the Rust tests using cargo test --manifest-path src-tauri/Cargo.toml.

CMD:cargo add --dev tokio --dev anyhow --dev tempfile --dev assert_cmd --dev predicates

/claim #184

Related to CapSoftware#184

Implement a scalable testing system for Rust functions in the Cap desktop application.

* **Add test cases**: Create a new file `apps/desktop/src-tauri/tests/desktop_tests.rs` with test cases for `start_recording`, `stop_recording`, `copy_file_to_path`, `copy_screenshot_to_clipboard`, and `export_video`.
* **Update package.json**: Add a new command `test:desktop` in `apps/desktop/package.json` to run the Rust tests using `cargo test --manifest-path src-tauri/Cargo.toml`.
@vercel

vercel Bot commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

@vishwamartur is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@algora-pbc

algora-pbc Bot commented Nov 27, 2024

Copy link
Copy Markdown

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

asegal-inflight added a commit to inflightsoftware/inflight-recorder that referenced this pull request Apr 15, 2026
Addresses Dependabot alerts CapSoftware#185, CapSoftware#186, CapSoftware#187 (GHSA class: rand >= 0.7 < 0.9.3
unsound under custom-logger + thread_rng combo — UB via aliased mutable
reference to BlockRng<ReseedingCore> when ThreadRng reseeds inside a logger
callback).

Changes:
- apps/desktop/src-tauri/Cargo.toml: rand 0.8.5 -> 0.9.3
- crates/workspace-hack/Cargo.toml: rand 0.8 -> 0.9 (both [dependencies] and
  [build-dependencies] entries)
- apps/desktop/src-tauri/src/platform/macos/delegates.rs: migrate call-site
  to the 0.9 API (rand::thread_rng() -> rand::rng(),
  rand::distributions::Alphanumeric -> rand::distr::Alphanumeric)
- Cargo.lock regenerated; Inflight crate now on rand 0.9.4, other transitive
  users bumped from 0.9.2 -> 0.9.4 (rand 0.8.5 remains only via phf_generator
  + tungstenite — those are not flagged by these alerts)

Build verification:
- cargo check -p workspace-hack: PASSED on Windows (all 0.9 transitive deps
  resolve and compile)
- cargo check -p Inflight: cannot verify end-to-end on this Windows host
  (FFmpeg bindgen requires libclang which isn't configured locally). The
  modified call-site is #[cfg(target_os = "macos")]-gated so macOS CI is
  the authoritative check. Migration is mechanical and matches the rand 0.9
  release notes.

Closes SEC-332 (pending PR merge + macOS CI green)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants